﻿@{
    if(TempData["Info"] != null){
        <script type="text/javascript">
            $(document).ready(function () {
                DisplayDialog('@(TempData["Info"].ToString())');
            });
        </script>
    }
}

@model MovieModel
           

    @Html.ValidationSummary(true)
        @Html.HiddenFor(model => model.Id)
         @Html.HiddenFor(model => model.CreatedAt)

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

         <div class="editor-label">
            @Html.LabelFor(model => model.Genre)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.Genre, Model.MovieGenreForDropDownBox)
            @Html.ValidationMessageFor(model => model.Genre)
        </div>

         <div class="editor-label">
            @Html.LabelFor(model => model.Location)
        </div>
         <div class="editor-field">
            @Html.EditorFor(model => model.Location)
            @Html.ValidationMessageFor(model => model.Location)
        </div>

         <div class="editor-label">
            @Html.LabelFor(model => model.VideoQuality)
        </div>

        <div class="editor-field">
            @Html.DropDownListFor(model => model.VideoQuality.VideoType, Model.VideoTypeForDropDownBox)
            @Html.ValidationMessageFor(model => model.VideoQuality.VideoType)
            @Html.DropDownListFor(model => model.VideoQuality.VideoResolution, Model.VideoResolutionForDropDownBox) 
            @Html.ValidationMessageFor(model => model.VideoQuality.VideoResolution)
        </div>

         <div class="editor-label">
            @Html.LabelFor(model => model.AudioQualities)
        </div>
       
        <div class="editor-field">

        @foreach (AudioQualityModel audioQuality in Model.AudioQualities)
        {
            @Html.DropDownListFor(model => audioQuality.AudioType, Model.GetAudioTypeForDropDownBox(audioQuality))
            @Html.ValidationMessageFor(model => audioQuality.AudioType)
            @Html.DropDownListFor(model => audioQuality.AudioChannels, Model.GetAudioChannelsForDropDownBox(audioQuality))
            @Html.ValidationMessageFor(model => audioQuality.AudioChannels)
            <br />
        }
        </div>    
                          
<div id="dialog" title="Info"></div>


